import {actions} from '../base';

let url = 'admin/api/app-source-config';

export default {
    namespaced: true,
    state: {
        all: [],
        options: {
            guideType: {
                0: {label: '默认', value: 0, },
                // 1: {label: '0.3元', value: 1, },
                // 2: {label: '只有1元', value: 2, },
            },
            payChannelAlipays: {
                '': {label: '原生', value: '', disabled: false,},
                'helloNow': {label: '你好', value: 'helloNow', disabled: true,},
                'adapay': {label: 'Adapay', value: 'adapay', disabled: false,},
            },
            payChannelWechats: {
                '': {label: '原生', value: '', disabled: false,},
                'helloNow': {label: '你好', value: 'helloNow', disabled: true,},
                // 'guanggu': {label: '光谷', value: 'guanggu', disabled: false,},
            },
        },
        request: {
            all: false,
        }
    },
    mutations: {
        SET_ALL (state, data) {
            state.all = data;
        },
        SET_REQUESTING (state, name) {
            state.request[name] = true;
        },
        SET_REQUESTED (state, name) {
            state.request[name] = false;
        }
    },
    actions: actions(url),
};
